<?php

class SupprimerSeanceAction extends Action{
	
	function execute( HttpRequest $request ){
			
		
		$DAOfactory=AbstractDAOFactory::getDaoFactory(AbstractDAOFactory::MYSQL);
		$seanceDAO=$DAOfactory->getSeanceDAO();
		$filmDAO=$DAOfactory->getFilmDAO();
		//on supprime l'enregistrement
		
		$seanceDAO->delete($request->getParameter('idseance'));
		
		//on fournit à la vue les paramétres qu'elle attend
		$filmTab=$filmDAO->getById($request->getParameter('idfilm'));
		$film=$filmTab[0];
		
		$listeSeances=$seanceDAO->getSeancesByFilmId($request->getParameter('idfilm'));
		$request->addMessage('Supression de la seance effectuee');
		$request->addObject('film',$film);
		$request->addObject('listeSeances',$listeSeances);
		return self::ACTION_DEFAULT;
		
		

		
	}
	
	
	
}